Conversation
Certseeds
commented
Oct 4, 2025
- 大幅度更新模板, 现在更方便, 内嵌了加速指令, 并且更新了许可证, 现在模板文件全部为Apache 2.0协议
- 加入2021fall的问题, 答案, 解析.
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
GPT5真的能秒 ICPC-2025 吗? Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR introduces template updates with embedded acceleration instructions and license changes to Apache 2.0, along with adding 2021 Fall exam problems, answers, and solutions.
- Major template upgrade with embedded acceleration instructions and Apache 2.0 license
- Addition of 2021 Fall lab problems with complete implementations
- Comprehensive algorithm solutions across multiple lab topics (linked lists, sorting, stacks/queues, strings, trees)
Reviewed Changes
Copilot reviewed 293 out of 599 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| Multiple lab_XX directories | Complete 2021 Fall semester lab problems with solutions and test cases |
| CMakeLists.txt files | Build configuration updates for new problem structure |
| README.md files | Algorithm analysis and problem descriptions for each lab |
| main.cpp files | Complete algorithm implementations for all problems |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| @@ -0,0 +1,247 @@ | |||
| // SPDX-License-Identifier: AGPL-3.0-or-later | |||
There was a problem hiding this comment.
The description mentions files are now under Apache 2.0 license, but the SPDX header still shows AGPL-3.0-or-later. This inconsistency should be resolved.
| // SPDX-License-Identifier: AGPL-3.0-or-later | |
| // SPDX-License-Identifier: Apache-2.0 |
| if (rev[u] == 0) { | ||
| while (!buckets[bu].empty()) { | ||
| int x = buckets[bu].back(); | ||
| buckets[bu].pop_back(); | ||
| buckets[bv].push_front(x); | ||
| } | ||
| } else { | ||
| while (!buckets[bu].empty()) { | ||
| int x = buckets[bu].front(); | ||
| buckets[bu].pop_front(); | ||
| buckets[bv].push_front(x); | ||
| } | ||
| } |
There was a problem hiding this comment.
[nitpick] Duplicated logic for bucket transfer operations. This code pattern appears multiple times with only minor variations. Consider extracting a helper function to reduce duplication.
| #pragma GCC optimize("-finline-small-functions") | ||
| #pragma GCC target("avx,avx2,sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native") |
There was a problem hiding this comment.
[nitpick] The target instruction set is quite aggressive and may not be compatible with all systems. Consider using a more conservative target or making it conditional.
| #pragma GCC optimize("-finline-small-functions") | |
| #pragma GCC target("avx,avx2,sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native") | |
| #pragma GCC optimize("-finline-small-functions") | |
| #ifdef ALGORITHM_ENABLE_AGGRESSIVE_TARGET | |
| #pragma GCC target("avx,avx2,sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native") | |
| #endif |
| } | ||
|
|
||
| static const auto faster_streams = [] { | ||
| srand(time(nullptr)); |
There was a problem hiding this comment.
[nitpick] Using time(nullptr) for seeding is predictable and not cryptographically secure. Consider using std::random_device for better randomness quality.